package com.project.forum.utils;

import org.apache.commons.codec.digest.DigestUtils;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:DELL
 * Date:2025-07-17
 * Time:21:22
 */
//MD5加密工具类
public class MD5Util {
    //对字符串进行加密
    //str：明文
    public static String md5 (String str){
        return DigestUtils.md5Hex(str);
    }

    //对用户密码进行加密
    /*str:密码明文，salt：扰动字符*/
    public static String md5Salt(String str,String salt){
        return md5(md5(str)+salt);
    }



}
